package org.dxw.common.util;

import org.dxw.service.UserService;
import org.dxw.service.impl.UserServiceImpl;

/**
 * @Author dxw
 * @Date 2023/11/19 22:30
 * @Description
 */
public class TypeUtil {

    public static void main(String[] args) {
        //true
        System.out.println(isAssignableFrom(UserService.class, UserServiceImpl.class));
    }


    public static boolean isAssignableFrom(Class superClz, Class sonClz){
        if(superClz == null || sonClz == null) return false;
        if(superClz.isAssignableFrom(sonClz)){
            return true;
        }else{
            return false;
        }
    }


}
